<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in</name>
<id>-1</id>
<cardCount>1102</cardCount>
<cardID>222949</cardID>
<listID>2377</listID>
<cantModify><false /></cantModify>
<cantDelete><false /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>512</width>
<height>342</height>
</cardSize>
<script>on openStack---- This script will ensure that the config setup happens-- even if SOD is started by directly entering this stack--global soundOn, noGoif soundOn is empty thenlock screenpush this card-- Just going to this card sets it up via it's openCard handlerput true into noGogo card "Dead Config" of stack "Dead Utility"if soundOn is empty then -- still empty ... we didn't make itsetDeadDefaultsend ifpop cardend ifhide messageend openStackon setDeadDefaultsglobal soundOnglobal soundStackglobal deadDirglobal defFileCreator--put false into soundOnput "Dead Utility" into soundStackput empty into deadDirput "MACA" into defFileCreatorend setDeadDefaultson searchpush this cardset the lockScreen to truego card "song search utility" of stack "Dead Utility"selectStack "Shows"end searchfunction correctPosition checkType, songListif checkType = "" then -- anywhere in stack...return trueend ifput SetPosition( Trim( field "songs" ) & return, ¬trim( songList ) & return ) into setPosput field "date" & " - " & setPos & " : " & checkTypeif checkType = "o1" then -- open first setif setPos is "o1" or setPos is "i1" then return truereturn falseend ifif checkType = "c1" then -- close first setif setPos is "c1" or setPos is "i1" then return truereturn falseend ifif checkType = "o2" then -- open second setif setPos is "o2" or setPos is "i2" then return truereturn falseend ifif checkType = "c2" then -- close second setif setPos is "c2" or setPos is "i2" then return truereturn falseend ifif checkType = "e" then -- encoreif second char of setPos is "e" then return truereturn falseend ifend correctPositionfunction beforeAndAfter theSongput Trim( field "songs" ) & return into setListrepeat with i = 1 to the number of lines in setListif ( line i of setList is theSong ) thenput line (i-1) of setList into beforeSongput line (i+1) of setList into afterSongif beforeSong is empty or afterSong is empty thenput SetPosition( setList, trim( theSong ) & return ) into setPosend ifif beforeSong is empty then put posWord( setPos ) into beforeSongif afterSong is empty then put posWord( setPos ) into afterSongreturn( beforeSong & " <> " & afterSong )end ifend repeatreturn emptyend beforeAndAfterfunction posWord setPosif char 1 of setPos is "o" thenreturn( "Open " & char 2 of setPos )end ifif char 1 of setPos is "c" thenreturn( "Close " & char 2 of setPos )end ifif setPos is "e" thenreturn( "Encore" )end ifif char 1 of setPos is "i" thenreturn( "Is set " & char 2 of setPos )end ifreturn ( "bogus" )end posWordfunction findShowByDate theShowDate-- a binary search through the cards.-- implemented when the stack got so large that brute force-- took way too longput the number of this card into origCardput theShowDate into searchDateconvert searchDate to secondsput the number of cards into endCardput trunc( endCard / 2 ) into targetCardput 1 into begCardset the cursor to 4set the lockScreen to truerepeat forevergo card targetCardget field "date"if it is theShowDate then return trueconvert it to secondsif it > searchDate thenput the number of this card into endCardelseput the number of this card into begCardend ifif (endCard - begCard) < 2 thengo card begCardget field "date"convert it to secondsif it is searchDate then return truego next cardget field "date"convert it to secondsif it is searchDate then return truego card origCard-- answer "Show date not found!"exit repeatend ifput trunc( begCard + ((endCard - begCard) / 2) ) into targetCard-- put begCard & " : " & targetCard & " : " & endCardend repeathide the messagereturn falseend findShowByDate--- stuff I don't really need--on sk orig, newer-- put "Mississippi Half-Step Uptown Toodeloo" into orig-- put "Mississippi Half-Step" into newerrepeat foreverfind string origput field "songs" into songListanswer "Replace?" with "OK" or "Skip" or "Cancel"if it is "Cancel" then exit repeatif it is "Skip" then next repeatrepeat with i = 1 to the number of lines in songListif line i of songList is orig thenput newer into line i of field "songs"exit repeatend ifend repeatanswer "Done" with "Cancel" or OKgo next cardend repeatend skon remSong theSongrepeat with i = 1 to the number of lines in field "songs"if line i of field "songs" is theSong thendelete line i of field "songs"exit repeatend ifend repeatend remSongon singAndDanceplayRandomDeadrepeat while the sound is not doneshowBusywait 4end repeatend singAndDanceon dance durationif duration is empty then put 60 into durationrepeat for durationshowBusywait 4end repeatend danceon showBusyglobal bearNumadd 1 to bearNumif bearNum = 9 then put 1 into bearNumset cursor to "Bear" & bearNumend showBusy-- NOTE: These scripts play songs from the stack specified in-- the configuration card in the utility stackon playDead songglobal soundStackpush this cardlock screenif soundStack is empty thenfindSoundStackend ifgo stack soundStackif the result is empty thenplayDeadSong songend ifpop cardend playDeadon playRandomDeadglobal soundStackpush this cardlock screenif soundStack is empty thenfindSoundStackend ifgo stack soundStackif the result is empty thenplayRandomDeadSongend ifpop cardend playRandomDead-- This handler manages help text for buttons and fields-- by taking the text from comments at the end of the scripts--on doHelpset the cursor to watchlock screenput "Help for " & the name of the target & "..." & return & return¬into field "help text"put the script of the target into theScript--repeat with i = 1 to the number of lines of theScript-- showBusyput line i of theScript into oneLineif oneLine is empty then next repeatif char 1 of oneLine is not "-" then exit repeatdelete char 1 to 2 of oneLineput oneLine & return after field "help text"end repeatshow field "help text"unlock screen with visual effect dissolve fastend doHelp---- WARNING ... Anything past here can be deleted...--on fixsbput 0 into countput "Beer Barrel Polka" & return into theSongsfind string theSongs in field "songs"repeat foreverfixSetadd 1 to countgo next cardfind string theSongs in field "songs"if the result is not empty then exit repeatend repeatput count & " shows fixed..."end fixsbon fixSetrepeat with i = 1 to the number of lines in field "songs"showBusyif (line i of field "songs") is "Beer Barrel Polka" thendelete line i of field "songs"exit repeatend ifend repeatend fixSet</script>